function [cv, r] = cov_nd(X,Y)
% cov_nd -  computes covariance and corrcoefs for vector pairs in N-D
%
% FORMAT:       [cv, r] = cov_nd(X,Y)
%
% Input fields:
%
%       X, Y        N-D double matrices of same size
%
% Output fields:
%
%       cv          covariance matrix
%       r           correlation coefficients matrix
%
% Note: cv and r are computed over the LAST dimension, so if X and Y
% are 10-by-30-by-50 matrices, cv and r are 10-by-30 matrices.
%
% This is a MEX (c compiled) function for efficiency. Results differ
% slightly from those obtained by calling MATLAB's cov/corrcoef.
%
% See also cov, corrcoef

% Version:  v0.7f
% Build:    8110521
% Date:     Nov-05 2008, 9:00 PM CET
% Author:   Jochen Weber, SCAN Unit, Columbia University, NYC, NY, USA
% URL/Info: http://wiki.brainvoyager.com/BVQXtools

% just to make sure
error( ...
    'BVQXtools:MEXMissing', ...
    'This is a compiled function, but the MEX file is missing.' ...
);
